function CheckinStatuses() {
	var checkins = new Object();
	
	this.addCheckin = function(date, user){
		if(user == undefined) return;
		if(checkins[date] == undefined){
			checkins[date] = [];
		}
		if(!this.hasUserEverCheckedInOnDate(user, date)){
			this.userDoInitialCheckin(user, date);
		}
		else{
			this.userDoAnotherCheckin(user, date);
		}
	}
	
	this.hasUserEverCheckedInOnDate = function(user, date){
		var result = false;
		for(i=0; i< checkins[date].length; i++){
			if(checkins[date][i].getName() == user){
				result = true;
			} 
		}
		return result;
	}
	
	this.userDoInitialCheckin = function(user, date){
		checkins[date].push(new Submitter(user));
	}
	
	this.userDoAnotherCheckin = function(user, date){
		for(i=0; i< checkins[date].length; i++){
			if(checkins[date][i].getName() == user){
				checkins[date][i].doCheckin();
			} 
		}
	}
	
	this.getCheckins = function(){
		return this.sortByDate(checkins);
	}	
	
	this.sortByDate = function(checkins){
		var checkinDateArray = [];
		for(checkinDate in checkins){
			checkinDateArray.push(checkinDate);
		}
		
		checkinDateArray.sort(function(x, y) {
			return x < y;
		});
		
		sortedCheckins = new Object();
		for(i=0; i<checkinDateArray.length; i++){
			sortedCheckins[checkinDateArray[i]] = checkins[checkinDateArray[i]];
		}
		return sortedCheckins;
	}
}